# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-egcd
_pkgname=egcd
pkgver=2.0.2
pkgrel=1
pkgdesc='Easy-to-import Python module with a basic, efficient, native implementation of the extended Euclidean algorithm.'
arch=('any')
url='https://pypi.org/project/egcd/'
license=('MIT')
depends=('python')
makedepends=('python-pip' 'python-build' 'python-wheel')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('7f1cac2c8461e062df1906709953d6104a86f328270256565168a9908b5fdbd76ded8c1549dc5f7e6fb61477b713b88f234bc82027d5614ff35663a3d3081d50')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname
}

